package com.feidee.fd.sml.algorithm.component.validation.action

import com.feidee.fd.sml.algorithm.component.validation.ValidationParam
import com.feidee.fd.sml.algorithm.util.Log
import com.google.gson.Gson
import org.apache.spark.sql.DataFrame

/**
  * @Author songhaicheng
  * @Date 2019/4/18 11:26
  * @Description
  * @Reviewer
  */
trait Action extends Log {
  def act(data: DataFrame, validationParam: ValidationParam): Boolean
  def apply(data: DataFrame, params: String, validationParam: ValidationParam): Boolean = {
    new Gson().fromJson(params, this.getClass).act(data, validationParam)
  }
}
